package vn.vietel.pms.entity;

import java.io.Serializable;

import static org.jboss.seam.ScopeType.EVENT;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;

@Entity
@Name("vlistofproperty")
@Scope(EVENT)
@Table(name = "VListOfProperty")
public class VListOfProperty implements Serializable {

	private static final long serialVersionUID = 1L;

	private Long id;
	private String propertyName;
	private String unitName;
	private Long qualityId;
	private String notation;
	private String madeInCountry;
	private double unitPrice;
	private String serialNumber;

	private VGroupOfProperty groupOfDevice;

	private VTypeOfProperty typeOfDevice;

	private VKindOfProperty kindOfDevice;

	public VListOfProperty(String propertyName, String unitName,
			Long qualityId, String notation, String madeInCountry,
			double unitPrice, String serialNumber) {
		super();
		this.propertyName = propertyName;
		this.unitName = unitName;
		this.qualityId = qualityId;
		this.notation = notation;
		this.madeInCountry = madeInCountry;
		this.unitPrice = unitPrice;
		this.serialNumber = serialNumber;
	}

	public VListOfProperty() {
		super();

	}

	@Id
	@Column(name = "propertyId")
	@GeneratedValue(strategy = GenerationType.AUTO)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@NotNull
	@Length(max = 500)
	public String getPropertyName() {
		return propertyName;
	}

	public void setPropertyName(String propertyName) {
		this.propertyName = propertyName;
	}

	public String getUnitName() {
		return unitName;
	}

	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}

	public Long getQualityId() {
		return qualityId;
	}

	public void setQualityId(Long qualityId) {
		this.qualityId = qualityId;
	}

	public String getNotation() {
		return notation;
	}

	public void setNotation(String notation) {
		this.notation = notation;
	}

	public String getMadeInCountry() {
		return madeInCountry;
	}

	public void setMadeInCountry(String madeInCountry) {
		this.madeInCountry = madeInCountry;
	}

	public double getUnitPrice() {
		return unitPrice;
	}

	public void setUnitPrice(double unitPrice) {
		this.unitPrice = unitPrice;
	}

	public String getSerialNumber() {
		return serialNumber;
	}

	public void setSerialNumber(String serialNumber) {
		this.serialNumber = serialNumber;
	}

	@ManyToOne()
	@JoinColumn(name = "groupId")
	public VGroupOfProperty getGroupOfDevice() {
		return groupOfDevice;
	}

	public void setGroupOfDevice(VGroupOfProperty groupOfDevice) {
		this.groupOfDevice = groupOfDevice;
	}

	@ManyToOne()
	@JoinColumn(name = "typeId")
	public VTypeOfProperty getTypeOfDevice() {
		return typeOfDevice;
	}

	public void setTypeOfDevice(VTypeOfProperty typeOfDevice) {
		this.typeOfDevice = typeOfDevice;
	}

	@ManyToOne()
	@JoinColumn(name = "kindId")
	public VKindOfProperty getKindOfDevice() {
		return kindOfDevice;
	}

	public void setKindOfDevice(VKindOfProperty kindOfDevice) {
		this.kindOfDevice = kindOfDevice;
	}
}
